<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
	<head>
	<meta charset="UTF-8">
	<title>Insert title here</title>
	</head>
	<body>
		<%
			Cookie cookie = new Cookie("name","tom");
			//设置 cookie 的存活周期 
			//单位是 秒 
			cookie.setMaxAge(20);
			response.addCookie(cookie);
		%>
	</body>
</html>